/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pyfntbreqper")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pyfntbreqper.findAll", query = "SELECT p FROM Pyfntbreqper p"),
    @NamedQuery(name = "Pyfntbreqper.findByPyfntbreqperid", query = "SELECT p FROM Pyfntbreqper p WHERE p.pyfntbreqperid = :pyfntbreqperid"),
    @NamedQuery(name = "Pyfntbreqper.findByCategoria", query = "SELECT p FROM Pyfntbreqper p WHERE p.categoria = :categoria"),
    @NamedQuery(name = "Pyfntbreqper.findByMesinicio", query = "SELECT p FROM Pyfntbreqper p WHERE p.mesinicio = :mesinicio"),
    @NamedQuery(name = "Pyfntbreqper.findByMesfin", query = "SELECT p FROM Pyfntbreqper p WHERE p.mesfin = :mesfin"),
    @NamedQuery(name = "Pyfntbreqper.findByMensual", query = "SELECT p FROM Pyfntbreqper p WHERE p.mensual = :mensual"),
    @NamedQuery(name = "Pyfntbreqper.findByDectercero", query = "SELECT p FROM Pyfntbreqper p WHERE p.dectercero = :dectercero"),
    @NamedQuery(name = "Pyfntbreqper.findByDeccuarto", query = "SELECT p FROM Pyfntbreqper p WHERE p.deccuarto = :deccuarto"),
    @NamedQuery(name = "Pyfntbreqper.findByAportepatronal", query = "SELECT p FROM Pyfntbreqper p WHERE p.aportepatronal = :aportepatronal"),
    @NamedQuery(name = "Pyfntbreqper.findByFreserva", query = "SELECT p FROM Pyfntbreqper p WHERE p.freserva = :freserva"),
    @NamedQuery(name = "Pyfntbreqper.findByFecharegistro", query = "SELECT p FROM Pyfntbreqper p WHERE p.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Pyfntbreqper.findByObservaciones", query = "SELECT p FROM Pyfntbreqper p WHERE p.observaciones = :observaciones")})
public class Pyfntbreqper implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pyfntbreqperid")
    private Integer pyfntbreqperid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "categoria")
    private String categoria;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mesinicio")
    private int mesinicio;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mesfin")
    private int mesfin;
    @Basic(optional = false)
    @NotNull
    @Column(name = "mensual")
    private double mensual;
    @Basic(optional = false)
    @NotNull
    @Column(name = "dectercero")
    private double dectercero;
    @Basic(optional = false)
    @NotNull
    @Column(name = "deccuarto")
    private double deccuarto;
    @Basic(optional = false)
    @NotNull
    @Column(name = "aportepatronal")
    private double aportepatronal;
    @Basic(optional = false)
    @NotNull
    @Column(name = "freserva")
    private double freserva;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "pyfntbreqperid")
    private Collection<Pyfntbpedidper> pyfntbpedidperCollection;
    @JoinColumn(name = "pyfntbpoaprogid", referencedColumnName = "pyfntbpoaprogid")
    @ManyToOne(optional = false)
    private Pyfntbpoaprog pyfntbpoaprogid;
    @JoinColumn(name = "pyfntbpoaid", referencedColumnName = "pyfntbpoaid")
    @ManyToOne(optional = false)
    private Pyfntbpoa pyfntbpoaid;

    public Pyfntbreqper() {
    }

    public Pyfntbreqper(Integer pyfntbreqperid) {
        this.pyfntbreqperid = pyfntbreqperid;
    }

    public Pyfntbreqper(Integer pyfntbreqperid, String categoria, int mesinicio, int mesfin, double mensual, double dectercero, double deccuarto, double aportepatronal, double freserva, Date fecharegistro) {
        this.pyfntbreqperid = pyfntbreqperid;
        this.categoria = categoria;
        this.mesinicio = mesinicio;
        this.mesfin = mesfin;
        this.mensual = mensual;
        this.dectercero = dectercero;
        this.deccuarto = deccuarto;
        this.aportepatronal = aportepatronal;
        this.freserva = freserva;
        this.fecharegistro = fecharegistro;
    }

    public Integer getPyfntbreqperid() {
        return pyfntbreqperid;
    }

    public void setPyfntbreqperid(Integer pyfntbreqperid) {
        this.pyfntbreqperid = pyfntbreqperid;
    }

    public String getCategoria() {
        return categoria;
    }

    public void setCategoria(String categoria) {
        this.categoria = categoria;
    }

    public int getMesinicio() {
        return mesinicio;
    }

    public void setMesinicio(int mesinicio) {
        this.mesinicio = mesinicio;
    }

    public int getMesfin() {
        return mesfin;
    }

    public void setMesfin(int mesfin) {
        this.mesfin = mesfin;
    }

    public double getMensual() {
        return mensual;
    }

    public void setMensual(double mensual) {
        this.mensual = mensual;
    }

    public double getDectercero() {
        return dectercero;
    }

    public void setDectercero(double dectercero) {
        this.dectercero = dectercero;
    }

    public double getDeccuarto() {
        return deccuarto;
    }

    public void setDeccuarto(double deccuarto) {
        this.deccuarto = deccuarto;
    }

    public double getAportepatronal() {
        return aportepatronal;
    }

    public void setAportepatronal(double aportepatronal) {
        this.aportepatronal = aportepatronal;
    }

    public double getFreserva() {
        return freserva;
    }

    public void setFreserva(double freserva) {
        this.freserva = freserva;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Pyfntbpedidper> getPyfntbpedidperCollection() {
        return pyfntbpedidperCollection;
    }

    public void setPyfntbpedidperCollection(Collection<Pyfntbpedidper> pyfntbpedidperCollection) {
        this.pyfntbpedidperCollection = pyfntbpedidperCollection;
    }

    public Pyfntbpoaprog getPyfntbpoaprogid() {
        return pyfntbpoaprogid;
    }

    public void setPyfntbpoaprogid(Pyfntbpoaprog pyfntbpoaprogid) {
        this.pyfntbpoaprogid = pyfntbpoaprogid;
    }

    public Pyfntbpoa getPyfntbpoaid() {
        return pyfntbpoaid;
    }

    public void setPyfntbpoaid(Pyfntbpoa pyfntbpoaid) {
        this.pyfntbpoaid = pyfntbpoaid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pyfntbreqperid != null ? pyfntbreqperid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pyfntbreqper)) {
            return false;
        }
        Pyfntbreqper other = (Pyfntbreqper) object;
        if ((this.pyfntbreqperid == null && other.pyfntbreqperid != null) || (this.pyfntbreqperid != null && !this.pyfntbreqperid.equals(other.pyfntbreqperid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pyfntbreqper[ pyfntbreqperid=" + pyfntbreqperid + " ]";
    }
    
}
